CREATE TRIGGER demod.emp_up_trg 
    BEFORE INSERT ON demod.emp 
    REFERENCING NEW AS New FOR EACH ROW
DECLARE
    tmpVar NUMBER;
/******************************************************************************
   NAME:       emp_up_trg
   PURPOSE:    

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        1/25/2013      ek2046       1. Created this trigger.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     emp_up_trg
      Sysdate:         1/25/2013
      Date and Time:   1/25/2013, 12:50:47 AM, and 1/25/2013 12:50:47 AM
      Username:        ek2046 (set in TOAD Options, Proc Templates)
      Table Name:      emp (set in the "New PL/SQL Object" dialog)
      Trigger Options:  (set in the "New PL/SQL Object" dialog)
******************************************************************************/
BEGIN
   tmpVar := 0;

   SELECT emp_pk_seq.NEXTVAL INTO tmpVar FROM dual;
   
   :NEW.empno := tmpVar;
   :NEW.hiredate := SYSDATE;
   
   EXCEPTION
     WHEN OTHERS THEN
       -- Consider logging the error and then re-raise
       RAISE;
END emp_up_trg;